<template>
    <div style="height:690px">
        <basic-edit ref="basicEdit" v-on:save-finished="select"></basic-edit>
        <el-card class="box-card">
            <div slot="header" class="clearfix" align="center">
                <span>基本信息</span>
                <el-button style="float: right; padding: 3px 0" type="text" @click="handleEditBasic(h_MemberOfTheFile)">
                    修改
                </el-button>
            </div>
            <div class="text item" align="center" style="height:580px">
                <el-row>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">档案号</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hFn}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">姓名</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hName}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">身份证</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hNumber}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">手机号</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hPhone}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">身高</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hHeight}} cm</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">体重</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hWeight}} KG</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">家族史</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hFamilyhistory}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">疾病史</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hAllergy}}</div>
                    </el-col>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-light"><br><br></div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple">过敏史</div>
                    </el-col>
                    <el-col :span="12">
                        <div class="grid-content bg-purple-light">{{h_MemberOfTheFile.hMedicalhistory}}</div>
                    </el-col>
                </el-row>
            </div>
        </el-card>
    </div>
</template>

<script>
    import { getMemberById } from '@/api/HMemberofthefile'
    import basicEdit from '@/components/Lixueseng520/basicEdit'

    export default {
        data() {
            return {
                h_MemberOfTheFile: [],
            }
        },
        methods: {
            select() {
                getMemberById(sessionStorage.getItem('is_loginID'))
                    .then(response => {
                        console.log(response);
                        this.h_MemberOfTheFile = response.data
                    })
                    .catch(error => {
                        this.outputError(error)
                    })
            },
            async handleEditBasic(row) {
                try {
                    this.$refs.basicEdit.$emit('opendEitMemberDialog', row)
                } catch (error) {
                    this.outputError(error)
                }
            }
        },
        components: { basicEdit },
        created() {
            if (window.sessionStorage) {
                const data = sessionStorage.getItem("is_login");
                console.log(data);
                if (data != null && data != "") {
                    console.log(12)
                } else {
                    this.$router.push({
                        path: '/patientlogin',
                    })
                    return
                }
            }
            this.select()
        }
    }
</script>

<style>

</style>
